package com.moli.iov.down.command.codec.encode.data;

import com.moli.iov.down.constants.Constant;
import com.moli.iov.down.model.dto.remoting.CommandDto;
import com.moli.iov.util.StringUtil;
import org.apache.commons.lang.ArrayUtils;

/**
 * <p>
 *  终端注册响应
 * </p>
 *
 * @author: zql
 * @Date: 2018/12/4 11:20
 */
public class RegisterResDataEncoder extends BaseEncoder implements DataEncoder {

    @Override
    public byte[] encode(CommandDto commandDto){

        byte[] all = getByteBuf(commandDto);
        String auth = Constant.TBOX_GEGISTER_AUTH;
        byte[] authByte = StringUtil.hexStringToByte(auth);
        all = ArrayUtils.addAll(all, authByte);
        return all;
    }
}
